﻿/**
 * id: 评论ID
 * text: 评论内容
 * source: 评论来源
 * favorited: 是否收藏
 * truncated: 是否被截断
 * created_at: 评论时间
 * user: 评论人信息,结构参考user
 * status: 评论的微博,结构参考status
 * reply_comment 评论来源，数据结构跟comment一致
 * 
 * @classDescription 微博回复各字段定义；
 * @author Jeff Kwok
 * @since 2010-07-21
 */

var WEIBO = window.WEIBO || {};

(function () {
	WEIBO.Comment = function(comment){
		if (comment==""){return null;}
		this.init(comment);
	};
	
	WEIBO.Comment.prototype.id = new String();
	WEIBO.Comment.prototype.text = new String();
	WEIBO.Comment.prototype.source = new String();
	WEIBO.Comment.prototype.favorited = false;
	WEIBO.Comment.prototype.truncated = false;
	WEIBO.Comment.prototype.created_at = new String();
	WEIBO.Comment.prototype.user = null;
	WEIBO.Comment.prototype.status = null;
	WEIBO.Comment.prototype.reply_comment = null;
	
	WEIBO.Comment.prototype.init = function(comment){
		this.id = comment.id;
		this.text = comment.text;
		this.source = comment.source;
		this.favorited = (comment.favorited)?true:false;
		this.truncated = (commtnt.truncated)?true:false;
		this.created_at = comment.created_at;
		this.user = new WEIBO.User(comment.user);
		this.status = new WEIBO.Status(comment.Status);
		this.reply_comment = new WEIBO.Comment(comment.reply_comment);
	}
}());
